Release 10.1A: OpenEdge Development:
Java Open Clients
Defining the schema for a temp-table parameter mapped to a java.sql.ResultSet
Defining the schema for a Progress 4GL
Note: If you pass a temp-table as anTABLEorTABLE-HANDLEparameter passed as ajava.sql.ResultSetis a multi-step process.java.sql.ResultSetparameter you must access the parameter as a data stream. For more information on accessing temp-tables asjava.sqlResultSetparameters, see Appendix C "Passing Temp-tables as SQL ResultSet Parameters."
![]()
To define the schema for a temp-table parameter passed as a
java.sql.ResultSet:
- Define a
com.progress.open4gl.ProResultSetMetaDataImplobject.- Add field descriptions to the
ProResultSetMetaDataImplobject.- If the parameter is for input or input-output, define a
java.sql.ResultSetto hold the parameter value.Note: You can also pass a temp-table parameter as a- Add the
ProResultSetMetaDataImplobject as a temp-table parameter to yourParamArrayobject using the appropriate set parameter method.ProDataGraph. For more information, see the "Defining the schema for a temp-table parameter mapped to a ProDataGraph" section.Defining a ProResultSetMetaDataImpl object
For each temp-table parameter you must define a
com.progress.open4gl.ProResultSetMetaDataImplobject:
numFieldsSpecifies the number of fields (or columns) in the temp-table.
Adding field descriptions to the ProResultSetMetaDataImpl object
Add the meta data for each field of the temp-table by calling the
setFieldMetaData()method on theProResultSetMetaDataImplobject for each column in the temp-table:
positionSpecifies the 1-based position of a mapped field in a Progress 4GL temp-table.
nameSpecifies a field name, typically set to the corresponding 4GL field name in the temp-table.
extentValueSpecifies the extent of an array, 0 or 1 for a scalar value.
proTypeSpecifies the value of a class constant defined in the
com.progress.open4gl.Parameterclass. The specified class constant indicates the 4GL data type of the mapped temp-table field. For more information on these class constants, see the sections on specifying field data type meta data for temp-tables in Chapter 4, " Passing Parameters." To identify the Java data type that the column property assumes for the specified 4GL data type, see the information on mapping temp-tables tojava.sql.ResultSetobjects in Appendix C "Passing Temp-tables as SQL ResultSet Parameters."Adding the ProResultSetMetaDataImpl object as a temp-table parameter
Add the
ProResultSetMetaDataImplobject by passing it as a parameter of theaddTable()oraddTableHandle()method that you use to add the temp-table parameter to theParamArrayobject. For more information, see the "TABLE or TABLE-HANDLE" sectionThis is an example that adds a temp-table as an input parameter:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |